<#include "/app/common/layout/__backstagemainlayout.html"/>


<#assign pageJavascript>
<!-- page specific plugin scripts -->
		<script src="${ContextPath}/admin/assets/js/jquery.dataTables.js"></script>
		<script src="${ContextPath}/admin/assets/js/jquery.dataTables.bootstrap.js"></script>
		<!-- inline scripts related to this page -->
		<script type="text/javascript">
			jQuery(function($) {
				var oTable1 = 
				$('#sample-table-2')
				//.wrap("<div class='dataTables_borderWrap' />")   //if you are applying horizontal scrolling (sScrollX)
				.dataTable( {
					bAutoWidth: false,
					"aoColumns": [
					  { "bSortable": false },
					  null, null,null, null, null,
					  { "bSortable": false }
					],
					"aaSorting": [],
			
					//,
					//"sScrollY": "200px",
					//"bPaginate": false,
			
					//"sScrollX": "100%",
					//"sScrollXInner": "120%",
					//"bScrollCollapse": true,
					//Note: if you are applying horizontal scrolling (sScrollX) on a ".table-bordered"
					//you may want to wrap the table inside a "div.dataTables_borderWrap" element
			
					//"iDisplayLength": 50
			    } );
				/**
				var tableTools = new $.fn.dataTable.TableTools( oTable1, {
					"sSwfPath": "../../copy_csv_xls_pdf.swf",
			        "buttons": [
			            "copy",
			            "csv",
			            "xls",
						"pdf",
			            "print"
			        ]
			    } );
			    $( tableTools.fnContainer() ).insertBefore('#sample-table-2');
				*/
				
				
				//oTable1.fnAdjustColumnSizing();
			
			
				$(document).on('click', 'th input:checkbox' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					//var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				};
			});
			
			$(document).ready(function(){
			    $('#orders').dataTable({
			    	"bPaginate": true,
			    	"language": {
			           "lengthMenu": '每页 <select>'+
			             '<option value="10">10</option>'+
			             '<option value="20">20</option>'+
			             '<option value="50">50</option>'+
			             '<option value="-1">全部</option>'+
			             '</select> 条记录'
			         },
			    });
			
			});
			
		</script>
</#assign>


<@mainlayout pageJavascript=pageJavascript pageCss=pageCss currentMenu="orderFlag-simplesListFlag">

<div class="page-header">
	<h1>
		工单管理 
		<small> <i class="ace-icon fa fa-angle-double-right"></i> 动态工单</small>
	</h1>
</div>
<div class="row">
	<div class="col-xs-12">
		<!-- PAGE CONTENT BEGINS -->
		
		<div class="row">
			<div class="col-xs-12">
				<div class="table-header">工单</div>
				<div>
					<table id="orders" class="table table-striped table-bordered table-hover"">
						<thead>
							<tr>
								<th>序号</th>
								<th>标题</th>
								<th class="hidden-480">申报部门</th>
								<th class="hidden-480">申报人</th>
								<th><i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>申报时间</th>
								<th class="hidden-480">当前状态</th>
								<th></th>
							</tr>
						</thead>
						
						<tbody>
							<#list ordersList as order>
							<tr>

								<td>${order_index+1}</td>
								<td>${(order.title)!}</td>
								<td class="hidden-480">${(order.off_branch)!}</td>
								<td class="hidden-480">${(order.off_user)!}</td>
								<td>${(order.offer_at)!}</td>

								<td class="hidden-480">
									<b>
									<#if order.status=0>
									<span class="green">已处理</span>
									<#elseif order.status=1>
									<span class="orange">处理中</span>
									<#elseif order.status=2>
									<span class="gray">未处理</span>
									</#if>
									</b>
								</td>

								<td>
									<div class="hidden-sm hidden-xs action-buttons">
										<a class="btn btn-minier btn-primary  blue" href="#"> 查看</a> 
										<a class="btn btn-minier btn-danger red" href="#"> 删除</a>
									</div>

									<div class="hidden-md hidden-lg">
										<div class="inline position-relative">
											<button class="btn btn-minier btn-yellow dropdown-toggle"
												data-toggle="dropdown" data-position="auto">
												<i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>
											</button>

											<ul
												class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
												<li>
													<a href="#" class="tooltip-info" data-rel="tooltip" title="查看"> 
														<span class="blue"> 
																<i class="ace-icon fa fa-search-plus bigger-120"></i>
														</span>
													</a>
												</li>

												<li>
													<a href="#" class="tooltip-error" data-rel="tooltip" title="删除"> 
														<span class="red">
															<i class="ace-icon fa fa-trash-o bigger-120"></i>
														</span>
													</a>
												</li>
											</ul>
										</div>
									</div>
								</td>
							</tr>
							</#list>
						</tbody>
					</table>
				</div>
			</div>
		</div>

		<!-- PAGE CONTENT ENDS -->
	</div>
	<!-- /.col -->
</div>
<!-- pageContent END -->

</@mainlayout>